<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <%@include file="frame/common.jsp" %>
    <title>API订阅申请</title>
    <style>
        .applyinfo {
            padding: 20px 0;
        }

        .nav-tabs > li.active > a {
            background-color: #E6E5E5;
        }

        .form-horizontal .control-label {
            text-align: left;
        }

        .form-horizontal textarea {
            resize: none;
        }

        #tenantInfoTable table tbody tr td:nth-child(odd) {
            vertical-align: middle;
            text-align: center;
        }
    </style>
    <script type="text/javascript">
        $(function () {
            //loadtenantType();
            validateForm();
        })

        function validateForm() {
            //debugger
            $("#seform").bootstrapValidator({
                fields: {
                    remark: {
                        validators: {
                            notEmpty: {
                                message: '请输入审批意见'
                            },
                            stringLength: {
                                min: 0,
                                max: 1024,
                                message: '请输入一个长度最多是 1024 的字符串'
                            }
                        }
                    }
                }
            });
        }


    </script>
</head>
<body>
<div class="content">
    <div class="container">
        <div class="row applyinfo">
            <div class="col-md-3">
                <label>标题：</label><span>API订阅申请</span>
            </div>
            <div class="col-md-3">
                <label>申请时间：</label> <span id="apiApproveStartTime">
					<fmt:formatDate type="date" value="${subInfo.apiApproveStartTime}" dateStyle="default"/>
					</span>
            </div>
        </div>
        <div>
            <!-- Nav tabs -->
            <ul class="nav nav-tabs" role="tablist">
                <li role="presentation" class="active">
                    <a href="#home" aria-controls="home" role="tab" data-toggle="tab">API审核查看</a>
                </li>
            </ul>

            <!-- Tab panes -->
            <div class="tab-content">
                <div role="tabpanel" class="tab-pane active" id="home">
                    <table class="table table-bordered table-hover ">
                        <thead>
                        <tr>
                            <th>API提供者</th>
                            <th>API名称</th>
                            <th>API版本</th>
                            <th>订阅应用</th>
                            <th>层级</th>
                            <th>API订阅者</th>
                        </tr>
                        </thead>
                        <thead>
                        <tr class="success">
                            <th>${subInfo.providerName}</th>
                            <th>${subInfo.apiName}</th>
                            <th>${subInfo.version}</th>
                            <th>${subInfo.applicationName }</th>
                            <th>${subInfo.tier}</th>
                            <th>${subInfo.subscriber}</th>
                        </tr>
                        </thead>
                    </table>

                    <div>
                        <label class="col-sm-2 control-label">历史审批意见：</label>
                        <table class="table table-bordered table-hover">
                            <thead>
                            <tr>
                                <th>提交人员</th>
                                <th>提交时间</th>
                                <th>是否同意</th>
                                <th>处理意见</th>
                            </tr>
                            </thead>
                            <tbody id="rowtbody2">
                            <c:forEach items="${recordList }" var="record">
                                <tr class="info">
                                    <td>${record.approver}</td>
                                    <td><fmt:formatDate type="date" value="${record.createDate}"
                                                        pattern="yyyy-MM-dd HH:mm"/></td>
                                    <c:if test="${record.recordApproveStatus==1 }">
                                        <td>同意</td>
                                    </c:if>
                                    <c:if test="${record.recordApproveStatus==0 }">
                                        <td>不同意</td>
                                    </c:if>
                                    <td>${record.view }</td>
                                </tr>
                            </c:forEach>
                            </tbody>
                        </table>
                    </div>


                    <form class="form-horizontal" action="completeTask" id="seform" method="post">
                        <input type="hidden" name="proInsId" value="${proInsId}"/>
                        <input type="hidden" name="taskId" value="${taskId}"/>
                        <input type="hidden" name="user" value="${loginUser}"/>
                        <div class="form-group">
                            <label class="col-sm-1 control-label">审批结果：</label>
                            <div class="col-sm-10">
                                <label class="radio-inline">
                                    <input type="radio" name="approvalSumup" id="yesRadio" value="1" checked/>
                                    同意
                                </label>
                                <label class="radio-inline">
                                    <input type="radio" name="approvalSumup" id="noRadio" value="0"/> 不同意
                                </label>
                            </div>
                        </div>
                        <%-- 江苏物联网项目--限额 --%>
                        <%-- <div class="form-group ">
                            <label class="col-sm-1 control-label">限额：</label>
                            <div class="input-group" style="width: 80%;margin-top: -4px;">
                                <label class="radio-inline">
                                    <div class="input-group-addon col-sm-2  input-sm" style="width: 50px;padding-left: 3px;line-height: 22px;height: 34px;text-align: center;margin: auto 0;">总次数:</div>
                                        <input type="text" class="form-control" name="totalCount" id="totalCount" placeholder="5000" style="width: 50%;">
                                    <div class="input-group-addon col-sm-2  input-sm" style="width: 50px;line-height: 22px;height: 34px;text-align: center;margin: auto 0;">次</div>
                                </label>
                                <label class="radio-inline">
                                    <input type="text" class="form-control" name="perDay" id="perDay"  style="width: 50%;">
                                    <div class="input-group-addon col-sm-2  input-sm" style="width: 50px;line-height: 22px;height: 34px;text-align: center;margin: auto 0;">次/日</div>
                                </label>
                                <label class="radio-inline">
                                    <input type="text" class="form-control" name="perWeek" id="perWeek"  style="width: 50%;">
                                    <div class="input-group-addon col-sm-2  input-sm" style="width: 50px;line-height: 22px;height: 34px;text-align: center;margin: auto 0;">次/周</div>
                                </label>
                                <label class="radio-inline">
                                    <input type="text" class="form-control" name="perMonth" id="perMonth" style="width: 50%;" >
                                    <div class="input-group-addon col-sm-2  input-sm" style="width: 50px;line-height: 22px;height: 34px;text-align: center;margin: auto 0;">次/月</div>
                                </label>
                            </div>
                        </div>--%>

                        <div class="form-group">
                            <label class="col-sm-2 control-label">意见：</label>
                            <div class="col-sm-12">
                                <textarea class="form-control" rows="5" name="remark" id="remark"></textarea>
                            </div>
                        </div>

                        <div class="form-group">
                            <div class="col-sm-offset-4 col-sm-1">
                                <button type="submit" class="btn btn-danger" id="saveBtn">提交</button>
                            </div>
                            <div class="col-sm-offset-1 col-sm-1">
                                <button type="button" class="btn btn-default"
                                        onclick="javascript:history.go(-1)">取消
                                </button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
</body>
</html>